<template>
  <div>
    <div class="top">
       <router-link to="/wode"> <span>&lt;</span></router-link>
      <span>收货地址</span>
    </div>
 <hr>
    <div class="top1">
      <span>获取微信收货地址</span>
      <span>&gt;</span>
    </div>
    <div>
      <van-address-list
        v-model="chosenAddressId"
        :list="list"
        default-tag-text="默认"
        @add="onAdd"
        @edit="onEdit"
      />
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant';
export default {
   data() {
    return {
      chosenAddressId: '1',
      list: [
        {
          id: '1',
          name: '张三',
          tel: '13000000000',
          address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
          isDefault: true,
        },
        {
          id: '2',
          name: '李四',
          tel: '1310000000',
          address: '浙江省杭州市拱墅区莫干山路 50 号',
        },
      ],
      disabledList: [
        {
          id: '3',
          name: '王五',
          tel: '1320000000',
          address: '浙江省杭州市滨江区江南大道 15 号',
        },
      ],
    };
  },
  methods: {
    onAdd() {
      Toast('新增地址');
      this.$router.push("/dizhi2")
    },
    onEdit(item, index) {
      Toast('编辑地址:' + index);
    },
  },
};
</script>

<style scoped>

.top{
  height: .5rem;
   line-height: .5rem;
font-size: .2rem;
margin-left: .15rem;

}
.top span{
margin-right: 1.2rem;
}
.top1{
height: 40px;
width: 320px;
line-height: .4rem;
border-radius: .1rem;
margin: .1rem auto;
padding: 0 .1rem;
display: flex;
justify-content: space-between;
background-color: aliceblue;
}
.top1 span:nth-child(2){
  font-size: .2rem;
}
</style>